<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <title>Noderce 管理中心</title>
    <link rel="stylesheet" href="/admin/assets/style.css">
    <script src="/libs/jquery.min.js"></script>
  </head>
  <body>
    <div id="wrapper">
      <div id="nav">
        <ul>
          <li><a href="/admin">Home</a><span> ›</span></li>
          <li><a href="/admin/comment">Comments</a>
        </ul>
        <div class="quick"><a href="/admin/post/write" title="Write Post"><span>Write</span></a></div>
      </div>
      <div id="comment-status">
        <a href="?status=1" data-status='1'>正常</a>
        <a href="?status=0" data-status='0'>垃圾评论</a>
      </div>
      <div id='comment-list'>
      	<ul>
      		<% comment_list.forEach(function(item){ %>
      		<li>
            <input type="checkbox" data-id="<%=item._id%>" />
      			<a href='/post?id=<%= item.post_id %>'><%= item.author %></a>
      			<span>&nbsp;post comment on&nbsp;</span>
            <% posts.forEach(function(post){ %> <% if (post._id == item.post_id){ %> <a href='/post/<%= post.slug %>'><%= post.title %></a> <% } %> <% }); %>
            <time><%= item.created %></time>
            <span>Status:<%= item.status %></span>
            <a class='action delete' href='/admin/comment/delete/<%=item._id%>'>Delete</a>
            <a class='action spam' href='/admin/submitSpam/<%=item._id%>'>SPAM</a>
            <div class='content'><%= item.content %></div>
      		<% }); %>
      	</ul>
      </div>
      <div id='clearfix'></div>
    </div>
    <script type="text/javascript">
      (function(){
        $("#comment-status").find("a[data-status='<%=status%>']").addClass('current');
      })();
    </script>
  </body>
</html>